package topday1_9.chj;

/**
 * @Auther:小陈的Java
 */
public class RecursiveDemo  {
    int sum=0;
    void sum(int i) {
        if(i<=100) {
            sum += i;
            i++;
           sum(i);
        }
        if (i==100)
            System.out.println(sum);
    }
    public static void main(String[] args) {
        RecursiveDemo recursiveDemo = new RecursiveDemo();
        recursiveDemo.sum(1);
    }
}
